package com.satan.upload.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.satan.upload.entity.File;
import com.satan.upload.vo.ResultVo;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
* @author Demon
* @description 针对表【tb_file】的数据库操作Service
* @createDate 2023-09-13 14:28:42
*/
public interface FileService extends IService<File> {
    Boolean addFile(File file);

    Boolean selectFileByMd5(String md5);

    List<File> selectFileList();

    ResultVo checkFile(String md5);

    ResultVo uploadChunk(MultipartFile chunk, String md5, Integer index, Integer chunkTotal, Long fileSize, String fileName, Long chunkSize);

    ResultVo getFileList();

    void download(String md5, String fileName, Integer chunkSize, Integer chunkTotal, Integer index, HttpServletResponse response);
}
